<form name="form1" id="form1" action="" method="post" enctype="multipart/form-data">
<input type="hidden" name="itemID" value="" />
<input type="hidden" name="mode" value="" />
<input type="hidden" name="type" value="" />
<table width="100%" border="0" cellpadding="5" cellspacing="2" class="list">
<tbody>
  <tr>
  	<td colspan="4">
  		<fieldset style="border:1px solid #999;">
  			<legend><b>Chọn danh mục tương ứng</b></legend>
  			<?php echo FunctionCommon::makeSelectHTML($this->danhMucA, "danhmuc", $this->danhmucid, false, "index.php?m=khohang&danhmucid=", true);?>
  		</fieldset>
	</td>
  </tr>
  <tr>
  	<td colspan="4">
  		<fieldset style="border:1px solid #999;">
  			<legend <?php if(count($this->categoryA)>0) {echo "style='color:#F00;'";}?>><b>Chọn những thể loại tương ứng</b></legend>
  			<?php echo FunctionCommon::makeSelectHTML($this->categoryA, "category", $this->iddm, false, "index.php?m=khohang&danhmucid=" . $this->danhmucid . "&iddm=", true);?>
  		</fieldset>
	</td>
  </tr>
  <tr>
  	<td colspan="4">
  		<fieldset style="border:1px solid #999;">
  			<legend <?php if(count($this->sCategoryA)>0) {echo "style='color:#F00;'";}?>><b>Chọn những thể loại tương ứng</b></legend>
  			<?php echo FunctionCommon::makeSelectHTML($this->sCategoryA, "scategory", $this->subiddm, false, "index.php?m=khohang&danhmucid=" . $this->danhmucid . "&iddm=" . $this->iddm . "&subiddm=", true);?>
  		</fieldset>
	</td>
  </tr>
  <tr>
  	<td colspan="4">
  		<fieldset style="border:1px solid #999;">
  			<legend <?php if(count($this->sanPhamA)>0) {echo "style='color:#F00;'";}?>><b>Chọn những sản phẩm tương ứng</b></legend>
  			<?php echo FunctionCommon::makeSelectHTML($this->sanPhamA, "sanpham", $this->idSP, false, "index.php?m=khohang&danhmucid=" . $this->danhmucid . "&iddm=" . $this->iddm . "&subiddm=" . $this->subiddm . "&idSP=", true);?> &nbsp;&nbsp;&nbsp;<span style="font-weight:bold;">Số lượng sản phẩm hiện có : <span style="color:#F00;"><?php echo count($this->arrContent);?></span> sản phẩm</span>
  		</fieldset>
	</td>
  </tr>
  <tr>
    <th width="5%" align="center" class="color-tr-tds"><span onclick="checkAll()">Check</span><br><span onclick="uncheckAll()">Uncheck</span></th>
    <th width="20%" align="center" class="color-tr-tds">Seri</th>
    <th width="20%" align="center" class="color-tr-tds">Mã thẻ</th>
    <th width="5%" align="center" class="color-tr-tds"><b>Delete</b></th>
   </tr>
   <?php if (count ($this->arrContent) > 0) {
   		$i=0;
   		foreach ($this->arrContent as $sanpham) {
   ?>
	   <tr class="<?php if ($i%2==0) echo 'blue'; else echo 'white';?>">
	     <td align="center"><input type="checkbox" name="checkdel[]" value="<?php echo $sanpham['id'];?>" /></td>
	     <td align="center"><?php echo ($sanpham['seri']!='') ? $sanpham['seri'] : '-';?></td>
	     <td align="center" onclick="frmSubmit('m=khohang&a=edit&danhmucid=<?php echo $this->danhmucid; ?>&iddm=<?php echo $this->iddm;?>&subiddm=<?php echo $this->subiddm;?>&idSP=<?php echo $this->idSP;?><?php echo constants::$pathUrl;?>', '<?php echo $sanpham['id']; ?>', '', '')">
   			<?php echo $sanpham['maSanPham'];?>
	     </td>
	     <td align="center" onclick="if(cfdelete()){frmSubmit('m=khohang&danhmucid=<?php echo $this->danhmucid; ?>&iddm=<?php echo $this->iddm;?>&subiddm=<?php echo $this->subiddm;?>&idSP=<?php echo $this->idSP;?><?php echo constants::$pathUrl;?>', '<?php echo $sanpham['id']; ?>', 'delete', '');}"><img src="images/default/b_usrdrop.png" /></td>
	   </tr>
   <?php 
   		$i++;
   		}
   }
   ?>
   	<tr>
     	<td width="5%" align="center" class="color-tr-td"><input onclick="if(cfdelete()){frmSubmit('m=khohang&danhmucid=<?php echo $this->danhmucid; ?>&iddm=<?php echo $this->iddm;?>&subiddm=<?php echo $this->subiddm;?>&idSP=<?php echo $this->idSP;?><?php echo constants::$pathUrl;?>', '<?php echo $sanpham['id']; ?>', 'deleteall', '');}" type="button" name="deleteall" value="Del All" style="background:none;"/></td>
    	<td align="left" class="color-tr-td">
    		<?php if ($this->flagAdd) :?>
    		<a href="index.php?m=khohang&a=edit&danhmucid=<?php echo $this->danhmucid; ?>&iddm=<?php echo $this->iddm;?>&subiddm=<?php echo $this->subiddm;?>&idSP=<?php echo $this->idSP;?><?php echo constants::$pathUrl;?>"><img src="images/default/b_add.png" border="0" width="27" /></a>
    		<?php else :?>
    		<a href="javascript.void(0)">&nbsp;</a>
    		<?php endif;?>
    	</td>
    	<td class="color-tr-td" align="left"><span style="border:1px solid #CCC;padding:3px 5px;cursor:pointer;font-weight:bold;" onclick="hrefLocation('<?php echo Session::Get("URLSENDMAIL");?>', '', '')">Quay lại</span></td>
    	<td class="color-tr-td">&nbsp;</td>
    </tr>
</tbody>
</table>
</form>